<template>
  <div class="bg">
    <nav-com
      :title="$t('quanxian')"
      :showView='showView'
      @back="backHandler()"
    ></nav-com>
    <div class="top-view1">
      <!--      权限管理-->
      <div class="content">
        <van-button type="default" class="w100" @click="changedelet()">{{ $t('deletquanxian') }} </van-button>
      </div>
      <div class="content">
        <van-button type="default" class="w100" @click="changereset()">{{ $t('resetquanxian') }} </van-button>
      </div>
      <!--      弹框-->
      <van-dialog v-model="showchangedelet" :title="$t('deletquanxiantishi')" show-cancel-button @confirm="confirmdelt" :confirm-button-text="$t('sure')" :cancel-button-text="$t('close')">
      </van-dialog>
      <van-dialog v-model="showchangereset" :title="$t('resetquanxiantishi')" show-cancel-button @confirm="confirmreset" :confirm-button-text="$t('sure')" :cancel-button-text="$t('close')">
      </van-dialog>
    </div>
  </div>
</template>
<script>
import { Toast } from 'vant';
import navCom from "@/components/nav-com.vue";
import {modifypwd, profile, userInfo} from "../../api/user";
import {cyclingRecordDel, resetMileage} from "../../api/deviceManagement";
export default {
  name: "bonusList",
  components: {
    navCom,
  },
  data() {
    return {
      checked:'',
      showView: true,
      showPage:true,
      showchangedelet:false,
      lichengValue:"",
      shareUser:{},
      passwords:'',
      oldpasswords:'',
      showchangereset:false,
    };
  },
  mounted() {
    this.init();
  },
  methods: {
    loginout(){

    },
    changedelet(){
      this.showchangedelet = true
    },
    changereset(){
      this.showchangereset = true
    },
    jumpTo(url,canshu){
      this.$router.push({path: url,
        query: {canshu:canshu}
      })
    },
    confirmdelt(){
      cyclingRecordDel().then((res) => {
        if (res.code == 1) {
          this.$toast(res.msg);
        }
      });
    },
    confirmreset(){
      resetMileage().then((res) => {
        if (res.code == 1) {
          this.$toast(res.msg);
        }
      });
    },
    //返回
    backHandler() {
      this.$router.go(-1);
    },
    clearHistory(){

      const nav = navigator.userAgent;
      if (nav.indexOf('Android') > -1 || nav.indexOf('Adr') > -1) {
        phone.clearHistory();
      } else if (!!nav.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)) {
        this.$bridge.callhandler('clearHistory', {}, res => {});
      }
      if( this.$i18n.locale=='zh'){
        this.$toast('清理缓存成功');
      }else if( this.$i18n.locale=='en'){
        this.$toast('Clean cache successfully');
      }else{
        this.$toast('Limpia tu caché');
      }
    },
    //初始化
    init() {
    },
  },
};
</script>
<style lang="scss" scoped>
.top-view1{
  margin-top: 26.23vw;
}
.m-b-10{
  margin-bottom: 10px;
}
.m-t-10{
  margin-top: 10px;
}
.content{
  padding: 20px 20px 0;
  .w100{
    width: 100%;
    font-size: 18px!important;
    border-radius: 8px;
  }
}
.van-cell__title, .van-cell__value {
  flex: 1;
  display: flex;
  align-items: center;
}
.rili-content{
  width: 90vw;
  background: #fff;

}
.linksuccess{
  padding: 10px;
  font-size: 22px;
  font-weight: 600;
  color: #303030;
  display: flex;
  align-items: center;
  justify-content: center;
}
::v-deep .van-cell{
  font-size:20px!important;
}
</style>
